import java.util.Scanner;
//递归打印数字的每一位
public class PrintNumber {
    public static void print(int n) {
        if(n < 10) {
            System.out.println(n);
            return;
        } else {
            print(n / 10);
            System.out.println(n % 10);
        }
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        print(n);
    }
}
